
<template>
    <el-main>
        <p class="title">用户管理</p>
        <el-table
            :data="userList"
            stripe
            style="width: 100%">
            <el-table-column
            prop="id"
            label="ID"
            width="180">
            </el-table-column>
            <el-table-column
            prop="username"
            label="用户名"
            width="180">
            </el-table-column>
            <el-table-column
            prop="email"
            label="邮箱">
            </el-table-column>
            <el-table-column
            prop="phone"
            label="电话">
            </el-table-column>
            <el-table-column
            prop="createTime"
            label="注册时间">
            </el-table-column>
        </el-table>
        <!-- 分页器 -->
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page.sync="currentPage3"
            :page-size="100"
            layout="prev, pager, next, jumper"
            :total="1000">
        </el-pagination>
    </el-main>
</template>

<script>
    import { userList } from "@/request/http";
    import { userPagination } from "@/request/http";
    export default {
        name : "UserList",
        data (){
            return {
                userList : []
            }
        },
        methods : {
            //ES7  异步函数
            async BeforeMethod(){
                const res = await userList({
                    pageNum : 1
                })
                console.log(res)
                this.userList = res.data.data.list;
            }
        },
        mounted(){   
            this.BeforeMethod() ;       
        }

    }
</script>

<style lang="scss" scoped>

</style>